1. Field of the Invention
The present invention relates to an image processing apparatus, and particularly to an image processing apparatus which can extract a contour line from a specific image region in image data of a processing target to obtain the same contour line between the image region and an image region adjacent thereto and a method of the image processing.
2. Description of the Related Art
Owing to recent progress in computerization of information, there has widely spread a system in which a paper document is not stored physically as it is, but a content of the paper document is optically read by a scanner or the like, the read data is stored as an electronic document, and this electronic document is transmitted to the other apparatus as needed. This electronic document contains, for example, a character region composed of characters or a photo region composed of photos photographing landscapes, and the like. There are some cases where the character region or the photo region is expanded or compressed to be displayed on a display apparatus or to be outputted to a printing apparatus or the like. In this case, high reproducibility of data displayed or outputted is in much demand. Therefore, there has been proposed a technology in which in regard to the character region or the photo region in the electronic document, a contour line is extracted from each group of pixels (hereinafter, image region) constructed of pixels each having a constant feature value. Then the extracted contour line is converted into vector data for enhancing the above reproducibility (for example, see Japanese Patent Publication No. 3026592).
Japanese Patent Publication No. 3026592 discloses a technology for being capable of extracting all contour lines from binary image by one time of a raster scan only. In this technology, vectors between pixels in a horizontal direction and in a perpendicular direction are detected based upon relation between both a target pixel set in an image and a close pixel in close proximity to the target pixel and a connection state of the vectors between the pixels each other is determined. The contour line of a region in an image is extracted based upon the determined connection relation of the vectors between the pixels. Since the contour line is extracted not from a center position of the pixel but from an edge unit of the pixel, the contour line can be extracted even from the image region constructed of pixels having one pixel width such as a narrow line. Further, the publication discloses that it is possible to extract not only a contour line from an image region composed of a pixel group in which pixels in the image are connected by four connections but also a contour line from an image region composed of a pixel group in which pixels in the image are connected by eight connections. In addition, the four connections means that a pixel is adjacent to at least one of adjacent pixels in the upper, lower, right and left sides (four vicinities). The eight connections means that a pixel is adjacent to pixels in the upper, lower, right, left, upper right, lower right, upper left, and lower left sides. For example, as shown in FIG. 4A, in a gray image region, the pixels are connected by four connections, and as shown in FIG. 4B, in a gray image region, the pixels are connected by eight connections.
Contour lines extracted by using the technology described in Japanese Patent Publication No. 3026592 will be explained with reference to FIGS. 3A-3C. A contour line 311 is extracted from a black image region 301 in the binary image shown in FIG. 3A. The contour line 311 is constructed of vector data in the vector form showing an outer periphery of the image region 301. It should be noted that since the contour line 311 shows the outer periphery of the image region 301, a contour line is referred to as an outer contour. Next, as shown in FIG. 3B, a contour line 312 and a contour line 313 are extracted from an image region 302. Since the contour line 313 shows an inner periphery of the image region 302, it is referred to as an inner contour. That is, the contour lines extracted from the image region 302 are constructed of one outer contour (contour line 312) and one inner contour (contour line 313). Next, as shown in FIG. 3C, a contour line 314, a contour line 315 and a contour line 316 are extracted from an image region 303. That is, the contour lines extracted from the image region 303 are constructed of one outer contour (contour line 314) and two inner contours (contour lines 315 and 316). In the contour extracting processing disclosed in Japanese Patent Publication No. 3026592, both the outer contour and inner contour are extracted by a raster scan with a matrix unit of 3×3 pixels.